// ignore_for_file: file_names, must_be_immutable, constant_identifier_names, slash_for_doc_comments, avoid_unnecessary_containers, prefer_const_constructors, unnecessary_cast, sized_box_for_whitespace, prefer_function_declarations_over_variables, overridden_fields, annotate_overrides, prefer_const_literals_to_create_immutables, unnecessary_null_comparison, deprecated_member_use

import 'package:base_pay/base_pay.dart';

class BasePayManager {
  // 单例公开访问点
  factory BasePayManager() => _sharedInstance();

  // 静态、同步、私有访问点
  static BasePayManager _sharedInstance() {
    return _instance;
  }

  // 静态私有成员，没有初始化
  static final BasePayManager _instance = BasePayManager._();

  // 私有构造函数
  BasePayManager._() {
    // 具体初始化代码
  }

  BasePayDelegate? delegate;

  List<SubscribeGroup> _subscribeGroupList = [];

  ///设置订阅组，iOS需要
  setSubscribeGroupList(List<SubscribeGroup> subGroupList) {
    _subscribeGroupList = [];
    for (var element in subGroupList) {
      _subscribeGroupList
          .add(SubscribeGroup(groupName: element.groupName, ids: element.ids));
    }
  }

  ///获取订阅组，iOS需要
  List<SubscribeGroup> getSubscribeGroupList() {
    return _subscribeGroupList;
  }
}
